package org.base.baseproject.common;

/**
 * 自定义错误码
 *
 * @author
 * @from
 */
public enum ErrorCode {

    SUCCESS(200, "ok"),
    ERROR(500, "服务器内部错误"),
    PARAMS_ERROR(400, "请求参数错误"),
    AUTH_ERROR(401, "认证失败"),
    NOT_HAVE_PERMISSION(403, "无权限"),
    NOT_FOUND(404, "请求数据不存在"),
    TOO_MANY_REQUEST(429, "请求过于频繁"),
    OPERATION_ERROR(400, "操作失败");
    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
